﻿using Volo.Abp.Caching;
using Volo.Abp.Features;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Xms.Abp.Domain;
using FeatureManagement.Localization;
using Xms.Abp.Modularity;

namespace FeatureManagement;

[DependsOn(
    typeof(FeatureManagementDomainSharedModule),
    typeof(AbpFeaturesModule),
    typeof(AbpCachingModule),
    typeof(XmsAbpDddDomainModule)
    )]
public class FeatureManagementDomainModule : XmsModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        Configure<FeatureManagementOptions>(options =>
        {
            options.Providers.Add<DefaultValueFeatureManagementProvider>();
            options.Providers.Add<EditionFeatureManagementProvider>();
        });

        Configure<AbpExceptionLocalizationOptions>(options =>
        {
            options.MapCodeNamespace(FeatureManagementConsts.ModuleName, typeof(FeatureManagementResource));
        });
    }
}
